﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" AutoEventWireup="true"
    CodeFile="LinkList.aspx.cs" Inherits="Member_Link_LinkList" Title="友情链接管理" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="Server">

    <script type="text/javascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
    </script>

    <form id="form1" action="">
        <div id="sub_content">
            <div class="pagetitle">
                友情连接管理</div>
            <div class="tishi">
                <span>提&nbsp;示：</span>·上传网站logo尽量用标准尺寸88*35大小图片！
            </div>
            <div class="main_Supply_nav">
                <ul>
                    <li class="MenuLiCheck">所有友情连接</li><li class="MenuLi"> <asp:HyperLink ID="lnkAdd" runat="server" NavigateUrl="~/member/Link/LinkAdd.aspx">添加友情链接</asp:HyperLink></li>
                    <li class="search">
                    <table cellpadding="0" cellspacing="0" border="0" width="540">
                <tr>
                    <td>
                        标题名称：
                        <asp:TextBox ID="txtKeyWord" runat="server"></asp:TextBox>
                        公司名称：<asp:TextBox ID="txtCompany" runat="server"></asp:TextBox>
                        <asp:Button ID="btnsubmit" runat="server" Text="立刻查找" OnClick="btnsubmit_Click" CssClass="i_button" /></td>
                </tr>
            </table>
                    </li>
                </ul>
            </div>
            <asp:GridView ID="grdUserLink" runat="server" AutoGenerateColumns="False" CellPadding="0" GridLines="None" DataKeyNames="ID" AllowPaging="false" CssClass="table_main">
                <Columns>
                    <asp:TemplateField HeaderText="选项">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                        <HeaderStyle CssClass="th20 tou" />
                        <ItemStyle CssClass="nolet" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="网站Logo">
                        <ItemTemplate>
                            <a href='<%# Eval("Url") %>' target="_blank">
                                <asp:Image ID="Image1" runat="server" Height="35" Width="80" ImageUrl='<%# Eval("Logo") %>' CssClass="table_photo" ToolTip='<%# Eval("Url") %>' /></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="链接标题">
                        <ItemTemplate>
                            <a href='<%# Eval("url") %>' target="_blank" style="text-decoration: none">
                                <%# Eval("Name") %>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Url" HeaderText="链接地址"></asp:BoundField>
                    <asp:TemplateField HeaderText="公司名称">
                        <ItemTemplate>
                            <%# Eval("CompanyName").ToString().Length <= 15 ? Eval("CompanyName").ToString() : Eval("CompanyName").ToString().Substring(0, 15) + "..."%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="审核">
                        <ItemTemplate>
                            <%# Eval("Verify").ToString()=="True"?"已审":"未审" %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <a href='LinkEdit.aspx?ID=<%# Eval("ID")%>&UserID=<%# Eval("UserID") %>'>编辑</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="#EEEEEE" Font-Bold="True" ForeColor="Black" BorderColor="#DDDDDD"
                    Height="30px" />
            </asp:GridView>
            <asp:Label ID="lblMessage" runat="server" Text="Label" Visible="False"></asp:Label>
            <div class="paging">
             <p><uc1:PageNo ID="PageNo1" runat="server" /></p>
                <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" /> 全选 
                <asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" Text="批量删除" CssClass="i_button" /></div>
        </div>
    </form>
</asp:Content>
